<template>
  <a-modal
    :visible.sync="showPurchaseOrderDetail"
    @cancel="closePurchaseOrderDetail"
    title="订单详情"
    cancelText="关闭"
    :width="modalWidth"
    destroyOnClose
    :confirmLoading="confirmLoading"
    :bodyStyle="tstyle">
    <template slot="footer">
      <a-button key="取消" @click="closePurchaseOrderDetail">关闭</a-button>
    </template>
    <a-card :title='"采购订单号："+ poNo +"|"+ poItemNo' :bordered="true">
      <a-row :span="24">
        <a-col :span="8">
          采购方编码：{{ filterDictText(this.purchaserHqCodeDictOptions, dataSourceDetail.purchaserCode) }}
        </a-col>
        <a-col :span="8">
          供应商编码：{{ dataSourceDetail.supplierCode }}
        </a-col>
        <a-col :span="8">
          供应商名称：{{ dataSourceDetail.supplierName }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          采购订单编码：{{ dataSourceDetail.poNo }}
        </a-col>
        <a-col :span="8">
          采购订单行项目号：{{ dataSourceDetail.poItemNo }}
        </a-col>
        <a-col :span="8">
          采购订单行项目id：{{ dataSourceDetail.poItemId }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          合同编号：{{ dataSourceDetail.conCode }}
        </a-col>
        <a-col :span="8">
          合同名称：{{ dataSourceDetail.conName }}
        </a-col>
        <a-col :span="8">
          采购方公司名称：{{ dataSourceDetail.buyerName }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          采购方物料编码：{{ dataSourceDetail.materialCode }}
        </a-col>
        <a-col :span="8">
          采购方物料描述：{{ dataSourceDetail.materialDesc }}
        </a-col>
        <a-col :span="8">
          采购数量：{{ dataSourceDetail.amount }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          合同编号（国网经法）：{{ dataSourceDetail.sellerConCode }}
        </a-col>
        <a-col :span="8">
          技术规范流水号：{{ dataSourceDetail.serialNumber }}
        </a-col>
        <a-col :span="8">
          合同签订日期：{{ dataSourceDetail.sellerSignTime }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          合同类型：{{ filterDictText(this.conTypeDictOptions, dataSourceDetail.conType) }}
        </a-col>
        <a-col :span="8">
          项目编号：{{ dataSourceDetail.prjCode }}
        </a-col>
        <a-col :span="8">
          工程项目名称：{{ dataSourceDetail.prjName }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          物资编码：{{ dataSourceDetail.matCode }}
        </a-col>
        <a-col :span="8">
          采购技术固化ID：{{dataSourceDetail.fixedTechId}}
        </a-col>
        <a-col :span="8">
          合同包号：{{ dataSourceDetail.pkgNo }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          合同批次号：{{ dataSourceDetail.bidBatCode }}
        </a-col>
        <a-col :span="8">
          固化ID描述：{{ dataSourceDetail.extDes }}
        </a-col>
        <a-col :span="8">
          物资大类编码：{{ dataSourceDetail.matMaxCode }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          物资中类编码：{{ dataSourceDetail.matMedCode }}
        </a-col>
        <a-col :span="8">
          物资小类编码：{{ dataSourceDetail.matMinCode }}
        </a-col>
        <a-col :span="8">
          物资大类名称：{{ dataSourceDetail.matMaxName }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          物资中类名称：{{ dataSourceDetail.matMedName }}
        </a-col>
        <a-col :span="8">
          物资小类名称：{{ dataSourceDetail.matMinName }}
        </a-col>
        <a-col :span="8">
          更新时间：{{ dataSourceDetail.modifyTime }}
        </a-col>
      </a-row>
    </a-card>
  </a-modal>
</template>

<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ViserChartDemo from '../../../../jeecg/report/ViserChartDemo'
  import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'

  export default {
    name: 'EipPurchaseDetail',
    mixins: [JeecgListMixin],
    components: { ViserChartDemo },
    props: {
      dataSourceDetail: {
        type: Object,
        default: false
      }
    },
    data() {
      //详细信息表头
      return {
        showPurchaseOrderDetail: true,      //详情页面
        poNo: '',                           //采购订单号
        poItemNo: '',                       //采购订单行项目号
        purchaserHqCodeDictOptions: [],
        conTypeDictOptions: [],
        modalWidth: '70%',
        tstyle: {
          'height': '450px',
          'overflow': 'auto'
        },
        loading: false,
        confirmLoading: false
      }
    }
    ,
    methods: {
      initDictConfig() {
        initDictOptions('purchaserHqCode').then((res) => {
          if (res.success) {
            this.purchaserHqCodeDictOptions = res.result
          }
        })
        initDictOptions('conType').then((res) => {
          if (res.success) {
            this.conTypeDictOptions = res.result
          }
        })
      },
      closePurchaseOrderDetail() {//详细信息是否关闭
        this.$emit('close')
      },
      loadData() {
        let purchaseOrder = this.dataSourceDetail
        this.poNo = purchaseOrder.poNo
        this.poItemNo = purchaseOrder.poItemNo
      }
    }
  }
</script>

<style scoped>

</style>